import React, { Component } from 'react';
import './Swipe.scss'
import { swipe } from '../../utils/api'
class Swipe extends Component {
    constructor(props){
        super(props)
        this.state={
            imgList:[]
        }
    }
    componentDidMount(){
        swipe().then((res)=>{
           this.setState({
            imgList:res.data.list
           })
        })
    }
    render() {
        return (
            <div className='swipe'>
                {
                    this.state.imgList.map((item)=>{
                        return(
                            <img src={item.pic} alt="" />
                        )
                    })
                }
            </div>
        );
    }
}

export default Swipe;